#include <iostream>
#include <cstring>
using namespace std;
char s[5000];
int a[5000],b[5000],c[5000];
int na,nb,nc;
int main()
{
	cin>>s+1;
	int na=strlen (s+1);
	for (int i=1;i<=na;i++)
		a[i]=s[na-i+1]-'0';
	cin>>s+1;
	int nb=strlen (s+1);
	for (int i=1;i<=nb;i++)
		b[i]=s[nb-i+1]-'0';
	if (na>nb)
		nc=na;
	else
		nc=nb;
	for (int i=1;i<=nc;i++)
		c[i]=a[i]-b[i];
	for (int i=1;i<=nc;i++)
		if (c[i]<0)
		{
			c[i+1]--;
			c[i]+=10;
		}
	while (c[nc]==0&&nc>1)
		nc--;
	for (int i=nc;i>=1;i--)
		cout<<c[i];
	return 0;
}
